package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@Controller
public class ModelTest {
    @RequestMapping("/m1/t1")
    public String  test1(HttpServletRequest request, HttpServletResponse response){

        HttpSession session = request.getSession();
        System.out.println(session.getId());

        return "test";
    }

     //没有配置视图解析器的时候：
//    public String  test1(Model model){
//        //转发
//        model.addAttribute("msg","ModelTest01");
////        return "forward:/WEB-INF/jsp/test.jsp";
//        //重定向
//        return "redirect:index.jsp";
//
//    }
}
